
$(document).ready(function(){





    jQuery.fn.limit=function(){
        var self = $("[limit]");
        self.each(function(){
            var objString = $(this).text();
            var objLength = $(this).text().length;
            var num = $(this).attr("limit");
            if(objLength > num){
                $(this).attr("title",objString);
                objString = $(this).text(objString.substring(0,num) + "...");
            }
        })
    }
    $(function(){
        $("[limit]").limit();
    })

    $('.data-table').dataTable({
		"bJQueryUI": true,
        "bAutoWidth": false,
        "bStateSave": false,
        "aoColumns": [
            null,
            null,
            null,
            null,
            null,
            { "sWidth":"8%"  },
            null,

            null,
            { "sWidth":"8%"  },
            null,

            null,
            { "sWidth":"10%"  }
        ],

        "sPaginationType": "full_numbers",
		"sDom": '<""l>t<"F"fp>',
        "oLanguage": {//下面是一些汉语翻译
            "sSearch": "搜索",
            "sLengthMenu": "每页显示 _MENU_ 条记录",
            "sZeroRecords": "没有检索到数据",
            "sInfo": "显示 _START_ 至 _END_ 条 &nbsp;&nbsp;共 _TOTAL_ 条",
            "sInfoFiltered": "(筛选自 _MAX_ 条数据)",
            "sInfoEmtpy": "没有数据",
            "sProcessing": "正在加载数据...",
            "sProcessing": "<img src='{{rootUrl}}global/img/ajaxLoader/loader01.gif' />", //这里是给服务器发请求后到等待时间显示的 加载gif
            "oPaginate":
            {
                "sFirst": "首页",
                "sPrevious": "前一页",
                "sNext": "后一页",
                "sLast": "末页"
            }
        }
    });



});



function deleteoper(id){
    var strjson=jQuery.param({'id':id,'oper':'del'});

    bootbox.dialog({
        message: "您确定要删除该记录？",
        title: "权限分级管理",
        buttons: {
            success: {
                label: "删 除",
                className: "btn-success",
                callback: function() {
                    $.ajax({
                        url : "roleadmin.html",
                        type : "post",
                        data: strjson,
                        success : function(result) {

                            $("#statusinfo").removeClass().addClass('alert alert-block alert-error');
                            $("#statusinfo").html(result.info);
                            if(result.status=="success")
                            {
                                $("#tr_"+id).remove();
                            }
                        }
                    });
                }
            },
            danger: {
                label: "取 消",
                className: "btn-danger",
                callback: function() {
                    ;
                }
            }
        }
    });

};